import request from "@/utils/request";
//查询所有产品
export function listAllProduct() {
  return request({
    url: "/product/listAll",
    method: "get",
  });
}


//分页查询
export function listProductByPage(data) {
  return request({
    url: "/product/page",
    method: "get",
    params:data
  });
}

//删除产品
export function delProduct(productId) {
  return request({
    url: "/product/" + productId,
    method: "delete"
  });
}

// 查询产品详细
export function getProduct(productId) {
  return request({
    url: '/product/' + productId,
    method: 'get'
  });
}


//新增产品
export function addProduct(data) {
  return request({
    url: "/product",
    method: "post",
    data: data
  });
}

// 修改产品
export function updateProduct(data) {
  return request({
    url: '/product',
    method: 'put',
    data: data
  })
}